<template>
	<view>
		<uni-collapse accordion>
			<!-- 书籍章节列表 -->
			<uni-collapse-item v-for="item in chapter" :key="item.id" :title="item.title">
				<template v-for="voc_item in bookVocList">
					<view class="voc" v-if="voc_item.chapter_id===item.id" :key="voc_item.id">
						<uni-icons type="circle" size="15"></uni-icons>
						<view @click="chickVoc('watch',voc_item.spelling)">{{voc_item.spelling}} </view>
					</view>
				</template>

			</uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	export default {
		name: "book-detail-voc",
		data() {
			return {
				bookVoc: [],
				chapter: [],
			};
		},
		methods:{
			chickVoc(type,spelling){
				uni.navigateTo({
					url:'/subpkg/review_voc/review_voc?type=' + type + '&keyword='+spelling
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
